import React, { Component } from 'react';
import { Redirect, Route, Switch } from 'react-router-dom';
import Foot from "../component/Foot.jsx";

export default class Index extends Component {
    render() {
        return (
            <>
                {/* <React.Suspense fallback={<mark>loading</mark>}> */}
                    <Switch>
                        <Route exact path="/home" component={React.lazy(()=>import ('../views/Home.jsx'))}></Route>
                        <Route exact path="/sort" component={React.lazy(()=>import ('../views/Sort.jsx'))}></Route>
                        <Route exact path="/cart" component={React.lazy(()=>import ('../views/Cart.jsx'))}></Route>
                        <Redirect to="/home"></Redirect>
                    </Switch>
                {/* </React.Suspense> */}
                <Foot />
            </>
        )
    }
}
